/*
 * VictoryView.java
 */

package victory;

import java.awt.BorderLayout;
import java.awt.FlowLayout;
import org.jdesktop.application.Action;
import org.jdesktop.application.ResourceMap;
import org.jdesktop.application.SingleFrameApplication;
import org.jdesktop.application.FrameView;
import org.jdesktop.application.TaskMonitor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.Timer;
import javax.swing.Icon;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;


/**
 * The application's main frame.
 */
 public class VictoryView extends FrameView {

   public VictoryView(SingleFrameApplication app) {
        super(app);        
        initComponents();        
        mainPanel.setLayout(new FlowLayout());
          
        // status bar initialization - message timeout, idle icon and busy animation, etc
        ResourceMap resourceMap = getResourceMap();
        int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout");
        messageTimer = new Timer(messageTimeout, new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                statusMessageLabel.setText("");
            }
        });
        messageTimer.setRepeats(false);
        int busyAnimationRate = resourceMap.getInteger("StatusBar.busyAnimationRate");
        for (int i = 0; i < busyIcons.length; i++) {
            busyIcons[i] = resourceMap.getIcon("StatusBar.busyIcons[" + i + "]");
        }
        busyIconTimer = new Timer(busyAnimationRate, new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                busyIconIndex = (busyIconIndex + 1) % busyIcons.length;
                statusAnimationLabel.setIcon(busyIcons[busyIconIndex]);
            }
        });
        idleIcon = resourceMap.getIcon("StatusBar.idleIcon");
        statusAnimationLabel.setIcon(idleIcon);
        progressBar.setVisible(false);

        // connecting action tasks to status bar via TaskMonitor
        TaskMonitor taskMonitor = new TaskMonitor(getApplication().getContext());
        taskMonitor.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                String propertyName = evt.getPropertyName();
                if ("started".equals(propertyName)) {
                    if (!busyIconTimer.isRunning()) {
                        statusAnimationLabel.setIcon(busyIcons[0]);
                        busyIconIndex = 0;
                        busyIconTimer.start();
                    }
                    progressBar.setVisible(true);
                    progressBar.setIndeterminate(true);
                } else if ("done".equals(propertyName)) {
                    busyIconTimer.stop();
                    statusAnimationLabel.setIcon(idleIcon);
                    progressBar.setVisible(false);
                    progressBar.setValue(0);
                } else if ("message".equals(propertyName)) {
                    String text = (String)(evt.getNewValue());
                    statusMessageLabel.setText((text == null) ? "" : text);
                    messageTimer.restart();
                } else if ("progress".equals(propertyName)) {
                    int value = (Integer)(evt.getNewValue());
                    progressBar.setVisible(true);
                    progressBar.setIndeterminate(false);
                    progressBar.setValue(value);
                }
            }
        });
      
    }

    @Action
    public void showAboutBox() {
        if (aboutBox == null) {
            JFrame mainFrame = VictoryApp.getApplication().getMainFrame();
            aboutBox = new VictoryAboutBox(mainFrame);
            aboutBox.setLocationRelativeTo(mainFrame);
        }
        VictoryApp.getApplication().show(aboutBox);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        mainPanel = new javax.swing.JPanel();
        menuBar = new javax.swing.JMenuBar();
        javax.swing.JMenu menuInicio = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        iniciarSesion = new javax.swing.JMenuItem();
        cerrarSesion = new javax.swing.JMenuItem();
        jSeparator1 = new javax.swing.JPopupMenu.Separator();
        javax.swing.JMenuItem salir = new javax.swing.JMenuItem();
        menuGestion = new javax.swing.JMenu();
        menuIGestionUsuario = new javax.swing.JMenu();
        itemBajaUsuario = new javax.swing.JMenuItem();
        itemModificarUsuario = new javax.swing.JMenuItem();
        menuIGestionCompetencias = new javax.swing.JMenu();
        itemAltaCompetencias = new javax.swing.JMenuItem();
        itemBajaCompetencias = new javax.swing.JMenuItem();
        itemModificarCompetencia = new javax.swing.JMenuItem();
        itemVerCompetencia = new javax.swing.JMenuItem();
        menuIGestionParticipantes = new javax.swing.JMenu();
        itemAltaParticipante = new javax.swing.JMenuItem();
        itemBajaParticipante = new javax.swing.JMenuItem();
        itemModificarParticipante = new javax.swing.JMenuItem();
        menuIGestionLugaresComp = new javax.swing.JMenu();
        itemAltaLugar = new javax.swing.JMenuItem();
        itemBajaLugar = new javax.swing.JMenuItem();
        itemModificarLugar = new javax.swing.JMenuItem();
        jSeparator2 = new javax.swing.JPopupMenu.Separator();
        menuIGenerarFixture = new javax.swing.JMenuItem();
        menuICargarResultados = new javax.swing.JMenuItem();
        menuMostrar = new javax.swing.JMenu();
        menuIFixtureCompetencia = new javax.swing.JMenuItem();
        menuITablaPosiciones = new javax.swing.JMenuItem();
        javax.swing.JMenu menuAyuda = new javax.swing.JMenu();
        javax.swing.JMenuItem menuItemAcercaDe = new javax.swing.JMenuItem();
        menuItemContenido = new javax.swing.JMenuItem();
        statusPanel = new javax.swing.JPanel();
        javax.swing.JSeparator statusPanelSeparator = new javax.swing.JSeparator();
        statusMessageLabel = new javax.swing.JLabel();
        statusAnimationLabel = new javax.swing.JLabel();
        progressBar = new javax.swing.JProgressBar();

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(victory.VictoryApp.class).getContext().getResourceMap(VictoryView.class);
        mainPanel.setToolTipText(resourceMap.getString("mainPanel.toolTipText")); // NOI18N
        mainPanel.setMaximumSize(new java.awt.Dimension(800, 600));
        mainPanel.setName("mainPanel"); // NOI18N
        mainPanel.setPreferredSize(new java.awt.Dimension(800, 600));
        mainPanel.setLayout(null);

        menuBar.setName("menuBar"); // NOI18N

        menuInicio.setText(resourceMap.getString("inicioMenu.text")); // NOI18N
        menuInicio.setName("inicioMenu"); // NOI18N
        menuInicio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuInicioActionPerformed(evt);
            }
        });

        javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(victory.VictoryApp.class).getContext().getActionMap(VictoryView.class, this);
        jMenuItem1.setAction(actionMap.get("registrarUsuario")); // NOI18N
        jMenuItem1.setIcon(resourceMap.getIcon("registrarUsuario.icon")); // NOI18N
        jMenuItem1.setText(resourceMap.getString("registrarUsuario.text")); // NOI18N
        jMenuItem1.setActionCommand(resourceMap.getString("registrarUsuario.actionCommand")); // NOI18N
        jMenuItem1.setName("registrarUsuario"); // NOI18N
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        menuInicio.add(jMenuItem1);

        iniciarSesion.setAction(actionMap.get("iniciarSesion")); // NOI18N
        iniciarSesion.setIcon(resourceMap.getIcon("iniciarSesion.icon")); // NOI18N
        iniciarSesion.setText(resourceMap.getString("iniciarSesion.text")); // NOI18N
        iniciarSesion.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        iniciarSesion.setName("iniciarSesion"); // NOI18N
        iniciarSesion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                iniciarSesionActionPerformed(evt);
            }
        });
        menuInicio.add(iniciarSesion);

        cerrarSesion.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.CTRL_MASK));
        cerrarSesion.setIcon(resourceMap.getIcon("cerrarSesion.icon")); // NOI18N
        cerrarSesion.setText(resourceMap.getString("cerrarSesion.text")); // NOI18N
        cerrarSesion.setName("cerrarSesion"); // NOI18N
        menuInicio.add(cerrarSesion);

        jSeparator1.setName("jSeparator1"); // NOI18N
        menuInicio.add(jSeparator1);

        salir.setAction(actionMap.get("quit")); // NOI18N
        salir.setIcon(resourceMap.getIcon("salir.icon")); // NOI18N
        salir.setText(resourceMap.getString("salir.text")); // NOI18N
        salir.setToolTipText(resourceMap.getString("salir.toolTipText")); // NOI18N
        salir.setName("salir"); // NOI18N
        menuInicio.add(salir);

        menuBar.add(menuInicio);

        menuGestion.setText(resourceMap.getString("gestionMenu.text")); // NOI18N
        menuGestion.setName("gestionMenu"); // NOI18N

        menuIGestionUsuario.setText(resourceMap.getString("menuIGestionUsuario.text")); // NOI18N
        menuIGestionUsuario.setName("menuIGestionUsuario"); // NOI18N

        itemBajaUsuario.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_B, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        itemBajaUsuario.setText(resourceMap.getString("itemBajaUsuario.text")); // NOI18N
        itemBajaUsuario.setActionCommand(resourceMap.getString("itemBajaUsuario.actionCommand")); // NOI18N
        itemBajaUsuario.setName("itemBajaUsuario"); // NOI18N
        itemBajaUsuario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                itemBajaUsuarioActionPerformed(evt);
            }
        });
        menuIGestionUsuario.add(itemBajaUsuario);

        itemModificarUsuario.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_M, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        itemModificarUsuario.setText(resourceMap.getString("itemModificarUsuario.text")); // NOI18N
        itemModificarUsuario.setActionCommand(resourceMap.getString("itemModificarUsuario.actionCommand")); // NOI18N
        itemModificarUsuario.setName("itemModificarUsuario"); // NOI18N
        itemModificarUsuario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                itemModificarUsuarioActionPerformed(evt);
            }
        });
        menuIGestionUsuario.add(itemModificarUsuario);

        menuGestion.add(menuIGestionUsuario);

        menuIGestionCompetencias.setText(resourceMap.getString("menuIGestionCompetencias.text")); // NOI18N
        menuIGestionCompetencias.setName("menuIGestionCompetencias"); // NOI18N
        menuIGestionCompetencias.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuIGestionCompetenciasActionPerformed(evt);
            }
        });

        itemAltaCompetencias.setText(resourceMap.getString("itemAltaCompetencias.text")); // NOI18N
        itemAltaCompetencias.setName("itemAltaCompetencias"); // NOI18N
        itemAltaCompetencias.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                itemAltaCompetenciasActionPerformed(evt);
            }
        });
        menuIGestionCompetencias.add(itemAltaCompetencias);

        itemBajaCompetencias.setText(resourceMap.getString("itemBajaCompetencias.text")); // NOI18N
        itemBajaCompetencias.setName("itemBajaCompetencias"); // NOI18N
        itemBajaCompetencias.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                itemBajaCompetenciasActionPerformed(evt);
            }
        });
        menuIGestionCompetencias.add(itemBajaCompetencias);

        itemModificarCompetencia.setText(resourceMap.getString("itemModificarCompetencia.text")); // NOI18N
        itemModificarCompetencia.setName("itemModificarCompetencia"); // NOI18N
        itemModificarCompetencia.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                itemModificarCompetenciaActionPerformed(evt);
            }
        });
        menuIGestionCompetencias.add(itemModificarCompetencia);

        itemVerCompetencia.setText(resourceMap.getString("itemVerCompetencia.text")); // NOI18N
        itemVerCompetencia.setName("itemVerCompetencia"); // NOI18N
        itemVerCompetencia.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                itemVerCompetenciaActionPerformed(evt);
            }
        });
        menuIGestionCompetencias.add(itemVerCompetencia);

        menuGestion.add(menuIGestionCompetencias);

        menuIGestionParticipantes.setText(resourceMap.getString("menuIGestionParticipantes.text")); // NOI18N
        menuIGestionParticipantes.setName("menuIGestionParticipantes"); // NOI18N

        itemAltaParticipante.setText(resourceMap.getString("itemAltaParticipante.text")); // NOI18N
        itemAltaParticipante.setName("itemAltaParticipante"); // NOI18N
        itemAltaParticipante.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                itemAltaParticipanteActionPerformed(evt);
            }
        });
        menuIGestionParticipantes.add(itemAltaParticipante);

        itemBajaParticipante.setText(resourceMap.getString("itemBajaParticipante.text")); // NOI18N
        itemBajaParticipante.setName("itemBajaParticipante"); // NOI18N
        menuIGestionParticipantes.add(itemBajaParticipante);

        itemModificarParticipante.setText(resourceMap.getString("itemModificarParticipante.text")); // NOI18N
        itemModificarParticipante.setName("itemModificarParticipante"); // NOI18N
        menuIGestionParticipantes.add(itemModificarParticipante);

        menuGestion.add(menuIGestionParticipantes);

        menuIGestionLugaresComp.setText(resourceMap.getString("menuIGestionLugaresComp.text")); // NOI18N
        menuIGestionLugaresComp.setName("menuIGestionLugaresComp"); // NOI18N

        itemAltaLugar.setText(resourceMap.getString("itemAltaLugar.text")); // NOI18N
        itemAltaLugar.setName("itemAltaLugar"); // NOI18N
        menuIGestionLugaresComp.add(itemAltaLugar);

        itemBajaLugar.setText(resourceMap.getString("itemBajaLugar.text")); // NOI18N
        itemBajaLugar.setName("itemBajaLugar"); // NOI18N
        menuIGestionLugaresComp.add(itemBajaLugar);

        itemModificarLugar.setText(resourceMap.getString("itemModificarLugar.text")); // NOI18N
        itemModificarLugar.setName("itemModificarLugar"); // NOI18N
        menuIGestionLugaresComp.add(itemModificarLugar);

        menuGestion.add(menuIGestionLugaresComp);

        jSeparator2.setName("jSeparator2"); // NOI18N
        menuGestion.add(jSeparator2);

        menuIGenerarFixture.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F, java.awt.event.InputEvent.CTRL_MASK));
        menuIGenerarFixture.setText(resourceMap.getString("menuIGenerarFixture.text")); // NOI18N
        menuIGenerarFixture.setName("menuIGenerarFixture"); // NOI18N
        menuIGenerarFixture.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuIGenerarFixtureActionPerformed(evt);
            }
        });
        menuGestion.add(menuIGenerarFixture);

        menuICargarResultados.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R, java.awt.event.InputEvent.CTRL_MASK));
        menuICargarResultados.setText(resourceMap.getString("menuICargarResultados.text")); // NOI18N
        menuICargarResultados.setName("menuICargarResultados"); // NOI18N
        menuICargarResultados.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuICargarResultadosActionPerformed(evt);
            }
        });
        menuGestion.add(menuICargarResultados);

        menuBar.add(menuGestion);

        menuMostrar.setText(resourceMap.getString("mostrarMenu.text")); // NOI18N
        menuMostrar.setName("mostrarMenu"); // NOI18N

        menuIFixtureCompetencia.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F, java.awt.event.InputEvent.ALT_MASK));
        menuIFixtureCompetencia.setText(resourceMap.getString("fixtureMenu.text")); // NOI18N
        menuIFixtureCompetencia.setName("fixtureMenu"); // NOI18N
        menuIFixtureCompetencia.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuIFixtureCompetenciaActionPerformed(evt);
            }
        });
        menuMostrar.add(menuIFixtureCompetencia);

        menuITablaPosiciones.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_T, java.awt.event.InputEvent.ALT_MASK));
        menuITablaPosiciones.setText(resourceMap.getString("tablaPosicionesMenu.text")); // NOI18N
        menuITablaPosiciones.setName("tablaPosicionesMenu"); // NOI18N
        menuITablaPosiciones.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuITablaPosicionesActionPerformed(evt);
            }
        });
        menuMostrar.add(menuITablaPosiciones);

        menuBar.add(menuMostrar);

        menuAyuda.setText(resourceMap.getString("ayudaMenu.text")); // NOI18N
        menuAyuda.setName("ayudaMenu"); // NOI18N

        menuItemAcercaDe.setAction(actionMap.get("showAboutBox")); // NOI18N
        menuItemAcercaDe.setText(resourceMap.getString("menuItemAcercaDe.text")); // NOI18N
        menuItemAcercaDe.setName("menuItemAcercaDe"); // NOI18N
        menuAyuda.add(menuItemAcercaDe);

        menuItemContenido.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_H, java.awt.event.InputEvent.CTRL_MASK));
        menuItemContenido.setText(resourceMap.getString("contenidoMenu.text")); // NOI18N
        menuItemContenido.setName("contenidoMenu"); // NOI18N
        menuAyuda.add(menuItemContenido);

        menuBar.add(menuAyuda);

        statusPanel.setName("statusPanel"); // NOI18N

        statusPanelSeparator.setName("statusPanelSeparator"); // NOI18N

        statusMessageLabel.setName("statusMessageLabel"); // NOI18N

        statusAnimationLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        statusAnimationLabel.setName("statusAnimationLabel"); // NOI18N

        progressBar.setName("progressBar"); // NOI18N

        javax.swing.GroupLayout statusPanelLayout = new javax.swing.GroupLayout(statusPanel);
        statusPanel.setLayout(statusPanelLayout);
        statusPanelLayout.setHorizontalGroup(
            statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(statusPanelSeparator, javax.swing.GroupLayout.DEFAULT_SIZE, 800, Short.MAX_VALUE)
            .addGroup(statusPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(statusMessageLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 630, Short.MAX_VALUE)
                .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(statusAnimationLabel)
                .addContainerGap())
        );
        statusPanelLayout.setVerticalGroup(
            statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(statusPanelLayout.createSequentialGroup()
                .addComponent(statusPanelSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(statusMessageLabel)
                    .addComponent(statusAnimationLabel)
                    .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(3, 3, 3))
        );

        setComponent(mainPanel);
        setMenuBar(menuBar);
        setStatusBar(statusPanel);
    }// </editor-fold>//GEN-END:initComponents

    private void menuInicioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuInicioActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_menuInicioActionPerformed

    @Action
    private void iniciarSesionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_iniciarSesionActionPerformed
    // TODO add your handling code here  
        mainPanel.removeAll();      
        mainPanel.setLayout(new FlowLayout());
        mainPanel.add(new CU002(), BorderLayout.CENTER);

    }//GEN-LAST:event_iniciarSesionActionPerformed

    
    @Action
     private void itemBajaUsuarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_itemBajaUsuarioActionPerformed
         // TODO add your handling code here:
      int i = JOptionPane.showConfirmDialog(null, "Desea eliminarse como usuario?", "Dar de baja a usuario", JOptionPane.YES_NO_OPTION, 2);
      //si presiona el botón SI
      if (i==0){
        System.out.println("Los datos fueron eliminados correctamente... No podrá volver a ingresar al sistema");
        JOptionPane.showMessageDialog(null, "Los datos fueron eliminados correctamente... No podrá volver a ingresar al sistema");
        mainPanel.removeAll();
        mainPanel.repaint();  
      }
     }//GEN-LAST:event_itemBajaUsuarioActionPerformed
     
     @Action
     private void itemModificarUsuarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_itemModificarUsuarioActionPerformed
         // TODO add your handling code here:
        mainPanel.removeAll();
        mainPanel.setLayout(new FlowLayout());
        mainPanel.add(new CU007(), BorderLayout.CENTER);
     }//GEN-LAST:event_itemModificarUsuarioActionPerformed

     @Action
     private void menuIGenerarFixtureActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuIGenerarFixtureActionPerformed
         // TODO add your handling code here:
        mainPanel.removeAll();      
        mainPanel.setLayout(new FlowLayout());
        
        
        //GENERA EL FIXTURE
        
        
     }//GEN-LAST:event_menuIGenerarFixtureActionPerformed

     private void menuICargarResultadosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuICargarResultadosActionPerformed
         // TODO add your handling code here:
        mainPanel.removeAll();      
        mainPanel.setLayout(new FlowLayout());
        mainPanel.add(new CU002(), BorderLayout.CENTER);
     }//GEN-LAST:event_menuICargarResultadosActionPerformed

     private void menuIFixtureCompetenciaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuIFixtureCompetenciaActionPerformed
         // TODO add your handling code here:
        mainPanel.removeAll();      
        mainPanel.setLayout(new FlowLayout());
        mainPanel.add(new CU019(), BorderLayout.CENTER);
     }//GEN-LAST:event_menuIFixtureCompetenciaActionPerformed

     private void menuITablaPosicionesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuITablaPosicionesActionPerformed
         // TODO add your handling code here:
        mainPanel.removeAll();      
        mainPanel.setLayout(new FlowLayout());
        mainPanel.add(new CU021(), BorderLayout.CENTER);
     }//GEN-LAST:event_menuITablaPosicionesActionPerformed

     private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
         // TODO add your handling code here:
         mainPanel.removeAll();
         mainPanel.setLayout(new FlowLayout());
         mainPanel.add(new CU001(), BorderLayout.CENTER);
     }//GEN-LAST:event_jMenuItem1ActionPerformed

     
     //NO HAY QUE DEJAR ESTE EVENTO
     private void itemVerCompetenciaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_itemVerCompetenciaActionPerformed
         // TODO add your handling code here:
         mainPanel.removeAll();
         mainPanel.setLayout(new FlowLayout());
         mainPanel.add(new CU020(), BorderLayout.CENTER);
     
     }//GEN-LAST:event_itemVerCompetenciaActionPerformed

     private void menuIGestionCompetenciasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuIGestionCompetenciasActionPerformed
         // TODO add your handling code here:
          mainPanel.removeAll();
         mainPanel.setLayout(new FlowLayout());
         mainPanel.add(new CU004(), BorderLayout.CENTER);
     }//GEN-LAST:event_menuIGestionCompetenciasActionPerformed

     private void itemBajaCompetenciasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_itemBajaCompetenciasActionPerformed
         // TODO add your handling code here:
         int i = JOptionPane.showConfirmDialog(null, "Desea eliminar la competencia?", "Dar baja", JOptionPane.YES_NO_OPTION, 2);
      //si presiona el botón SI
      if (i==0){
        JOptionPane.showMessageDialog(null, "Los datos de la competencia fueron eliminados correctamente");
        System.out.println("Los datos de la competencia fueron eliminados correctamente");
        mainPanel.removeAll();
        mainPanel.repaint();  
      }
     }//GEN-LAST:event_itemBajaCompetenciasActionPerformed

     private void itemModificarCompetenciaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_itemModificarCompetenciaActionPerformed
         // TODO add your handling code here:
          mainPanel.removeAll();
         mainPanel.setLayout(new FlowLayout());
         mainPanel.add(new CU005(), BorderLayout.CENTER);
     }//GEN-LAST:event_itemModificarCompetenciaActionPerformed

     private void itemAltaCompetenciasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_itemAltaCompetenciasActionPerformed
         // TODO add your handling code here:
         mainPanel.removeAll();
         mainPanel.setLayout(new FlowLayout());
         mainPanel.add(new CU004(), BorderLayout.EAST);
     }//GEN-LAST:event_itemAltaCompetenciasActionPerformed

     private void itemAltaParticipanteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_itemAltaParticipanteActionPerformed
         mainPanel.removeAll();
         mainPanel.setLayout(new FlowLayout());
         mainPanel.add(new CU009(), BorderLayout.CENTER);
         mainPanel.updateUI();
     }//GEN-LAST:event_itemAltaParticipanteActionPerformed

    

   
    private JDialog aboutBox;  //acerca de..  
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenuItem cerrarSesion;
    private javax.swing.JMenuItem iniciarSesion;
    private javax.swing.JMenuItem itemAltaCompetencias;
    private javax.swing.JMenuItem itemAltaLugar;
    private javax.swing.JMenuItem itemAltaParticipante;
    private javax.swing.JMenuItem itemBajaCompetencias;
    private javax.swing.JMenuItem itemBajaLugar;
    private javax.swing.JMenuItem itemBajaParticipante;
    private javax.swing.JMenuItem itemBajaUsuario;
    private javax.swing.JMenuItem itemModificarCompetencia;
    private javax.swing.JMenuItem itemModificarLugar;
    private javax.swing.JMenuItem itemModificarParticipante;
    private javax.swing.JMenuItem itemModificarUsuario;
    private javax.swing.JMenuItem itemVerCompetencia;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JPopupMenu.Separator jSeparator1;
    private javax.swing.JPopupMenu.Separator jSeparator2;
    private javax.swing.JPanel mainPanel;
    private javax.swing.JMenuBar menuBar;
    private javax.swing.JMenu menuGestion;
    private javax.swing.JMenuItem menuICargarResultados;
    private javax.swing.JMenuItem menuIFixtureCompetencia;
    private javax.swing.JMenuItem menuIGenerarFixture;
    private javax.swing.JMenu menuIGestionCompetencias;
    private javax.swing.JMenu menuIGestionLugaresComp;
    private javax.swing.JMenu menuIGestionParticipantes;
    private javax.swing.JMenu menuIGestionUsuario;
    private javax.swing.JMenuItem menuITablaPosiciones;
    private javax.swing.JMenuItem menuItemContenido;
    private javax.swing.JMenu menuMostrar;
    private javax.swing.JProgressBar progressBar;
    private javax.swing.JLabel statusAnimationLabel;
    private javax.swing.JLabel statusMessageLabel;
    private javax.swing.JPanel statusPanel;
    // End of variables declaration//GEN-END:variables

    private final Timer messageTimer;
    private final Timer busyIconTimer;
    private final Icon idleIcon;
    private final Icon[] busyIcons = new Icon[15];
    private int busyIconIndex = 0;

   


    
}
